#ifndef SENDER_H
#define SENDER_H

#include <QObject>

class QStandardItem;
class QStandardItemModel;

class MessageDeliver : public QObject
{
	Q_OBJECT

public:
	MessageDeliver(QObject *reciver);
	~MessageDeliver();

	void updateCompletedItem(QStandardItem *item);	// To append the processed item to [member mResultModel].
	void updateFialedItem(const QString strFail);	// To report the failed item.
	void updateResultLabel(const QString &string);	// To update result label which is above of result tree view.
	void searchReplaceCompleted(QString string); // Searcher completed or interrupted will trigger this.
	void otherOperationCompleted();
	//void finished(int matchNum);
	void popUpWarning(const QString &title, const QString &content);	// Pop up a warning box with blocking.
	void popUpQuestion(const QString &title, const QString &content);	// Pop up question box, mainly for as whether to commit replace.
	void popUpReplace(QStandardItemModel *model);	// Pop up the replace dialog.
	void initialProgressRange(const int maximum);
	void getReply(const int replyVal);	// Get reply from main thread.
	void updateProgressBar(const int i, const QString &text);
	void parallelWorkCompleted();

signals:
	void txUpdateCompletedItem(QStandardItem *item);
	void txUpdateResultLabel(const QString &string);
	void txUpdateFailedItem(const QString s);
	void txSearchReplaceCompleted(QString string);
	void txOtherOperationCompleted();
	void txPopUpWarning(const QString &title, const QString &content);
	void txPopUpQuestion(const QString &title, const QString &content);
	void txPopUpReplace(QStandardItemModel *model);
	//void txResult(const int matchNum);
	void txInitialProgressRange(const int maximum);
	void txUpdateProgressBar(const int i, const QString &text);
	void txReplyValue(int replyVal);
	void txParallelWorkCompleted();


};

#endif // SENDER_H
